package com.shenda.device.message;

/**
 * 基于命令: 解决某些命令连在了一起的问题
 * 
 * @author lifeng
 */
public class RespMsg_Cmd extends RespMsg {

	/**
	 * 默认是14个字符长度
	 * 
	 * @return
	 */
	@Override
	public int commandLength() {
		return 7;
	}

	/**
	 * 默认的解析方式
	 */
	@Override
	public RespMsg parse(byte[] data) {
		String message = this.encodeHex(data);
		this.head = message.substring(0, 6);
		this.content = message.substring(8, message.length() - 4);
		this.end = message.substring(message.length() - 4);
		return this;
	}
}